package com.hmall.common.client;

import com.hmall.common.pojo.Item;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;


@FeignClient("itemservice")
@RequestMapping("/item")
public interface ItemClient {

    @GetMapping("/{id}")
    Item getById(@PathVariable Long id);

    @PutMapping("/stock/{itemId}/{num}")
    void deductStock(@PathVariable Long itemId, @PathVariable Integer num);

}
